第 15 步:太好了!现在,如果我们的get_user_input函数抛出错误,它不会阻止程序运行。

  • 点击运行并输入第一个问题的文本。您是否收到错误弹出窗口?
  • 我们的程序不会停止,而是在except下运行代码,然后照常继续。
  • 准备好后,单击提交接下来继续。

    To navigate the page using the TAB key, first press ESC to exit the code editor.

    # THIS ACTIVITY IS IN PREVIEW ONLY MODE
    • Run Code
    • Submit Work
    • Next Activity
    • Show Console
    • Reset Code Editor
    • Codesters How To (opens in a new tab)